import './alert.css';

const $ = window.$;

export default function alert(message) {
  const id = `al${parseInt(Math.random() * 1000, 10)}`;
  const box = $(`<div id="${id}" class="alert">
    <div class="box">
      <div class="msg">${message}</div>
      <div class="button">确 定</div>
    </div>
  </div>`);
  $('.button', box).click(() => {
    $(`#${id}`).remove();
  });
  $('body').append(box);
}
